package com.framework.main.sys.syssetting.service;

import java.util.Locale;

import javax.servlet.ServletContext;

import org.springframework.web.context.ServletContextAware;

import com.framework.base.util.StringUtil;

public class SysSettingServiceImp implements SysSettingService,ServletContextAware {
	
	public static ServletContext context;//声明一个静态变量保存
	public String setLanguage(String value) {
		if (StringUtil.isNullorEmpty(value)||"zh_CN".equals(value)) {
			context.setAttribute("language", "zh_CN");
			Locale.setDefault(Locale.SIMPLIFIED_CHINESE);
		}else {
			context.setAttribute("language", "us");
			Locale.setDefault(Locale.US);
		}		
		return "true";
	}

	@Override
	public void setServletContext(ServletContext context) {
		this.context=context;
	}

}
